package com.pilates

import java.text.SimpleDateFormat;


public class Aula {
	
	
	Date data
	static belongsTo = [turma:Turma]
	static hasMany = [presencas:Presenca]

    @Override
	public String toString() {
		SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy");
		return turma.toString()+ " - "+df.format(data);
	}

	static propertyMappings = {
		data(type:'DATETIME');
	}

	static mapping = {
		sort data:"desc"
	}
	
	static constraints = {
		turma()
		data()
		presencas()
		
	}
}
